//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Packaging;

namespace Microsoft.Research.DataLayer
{
    public class PropHandlerBase
    {
        private string objectName;

        private string propName;

        public delegate void InsertHandler(Connection.Storage obj1, Connection.Storage obj2,
            object objId, ref List<Parameter> paramList, string objKind, ref Package container,
            string partType);

        public delegate void FetchHandler();

        public delegate void UpdateHandler(Connection.Storage obj, List<Parameter> paramList,
            string objKind, ref Package container, string partType);

        public delegate void DeleteHandler(string objKind, Guid id, ref Package container);

        public InsertHandler insertHandler;

        public FetchHandler fetchHandler;

        public UpdateHandler updateHandler;

        public DeleteHandler deleteHandler;

        public string ObjectName
        {
            get { return this.objectName; }
            set { this.objectName = value; }
        }

        public string PropertyName
        {
            get { return this.propName; }
            set { this.propName = value; }
        }
    }

    public class BlobHandlerBase
    {
        private string objectName;

        public string ObjectName
        {
            get { return this.objectName; }
            set { this.objectName = value; }
        }

        public delegate void SaveContents(Package myPackage, Connection.Storage obj1, Connection.Storage obj2,
            object objId, string objKind, OPCConnection conn, ref List<Parameter> paramList);

        public delegate void FetchContents(IObject obj1, string field, Connection.Storage obj2Type,
            Connection.ObjectCreator creator, Package myPackage, OPCConnection conn, out List<IObject> results);

        public SaveContents saveContents;

        public FetchContents fetchContents;
    }

}
